package com.aihome.springbootjwt.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @ClassName WebConfigInterceptor
 * @Description 拦截器
 * @Author zhangjigang
 * @Date 2021/3/23 18:48
 * @Version 1.0.0
 */
@Configuration
public class WebConfigInterceptor extends WebMvcConfigurationSupport {

    @Autowired
    private LoginTokenInterceptor loginTokenInterceptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginTokenInterceptor).addPathPatterns("/**")
                .excludePathPatterns("/token/getToken");
    }
}
